<%@ include file="header.jsp" %>

<%@ page language="java" contentType="text/html; charset=US-ASCII"
    pageEncoding="US-ASCII"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Catalog</title>
</head>
<body>
<%@ page import="Beans.Movie, ServiceInterface.ServiceProxy" %>
<%
	ServiceProxy proxy = new ServiceProxy();
	proxy.setEndpoint("http://localhost:8079/VLMS3/services/Service");
	System.out.println("In AllMovies.jsp ");
	
	Movie[] movies = proxy.listMovies();
%>
<h1> Welcome to Movie Catalog</h1>
	<table>
	<tr>
	<th>Movie ID</th>
	<th>Title</th>
	<th>Banner</th>
	<th>Release Date</th>
	<th>Fee</th>
	<th>Category</th>
	<th>Quantity</th>
	</tr>
	<% //populate form table showing item details plus order quanity
	for(int i = 0; i < movies.length; i++){%>
	<tr>
		<td><%=movies[i].getMovieID() %></td>
		<td><%=movies[i].getTitle() %></td>
		<td><%=movies[i].getBanner() %></td>
		<td><%=movies[i].getDate() %></td>
		<td><%=movies[i].getRentalFee() %></td>
		<td><%=movies[i].getCategory() %></td>
		<td><%=movies[i].getQuantity() %></td>
	</tr>
	<% }%>
	</table>
</body>
</html>